<template>
  <a-drawer v-model:visible="LAYER.visible" :title="LAYER.title" :width="LAYER.width"
            :closable="LAYER.closable" :mask-closable="LAYER.maskClosable" :esc-to-close="LAYER.escToClose"
            :unmount-on-close="LAYER.unmountOnClose" :footer="LAYER.footer" :ok-text="LAYER.okText"
            :ok-loading="LAYER.okLoading" :cancel-text="LAYER.cancelText" @close="onCancel">


    <a-list :data="record.items" :bordered="false" title="参数详情" size="small">

      <template #item="{ item ,index }">
        <a-list-item>
          <template #actions>

            <a-typography-paragraph copyable type="danger">
              {{ item.value }}
            </a-typography-paragraph>


          </template>
          <a-list-item-meta :description="item.description" :title="`${item.name}[ ${item.code} ]`"/>
        </a-list-item>
      </template>
    </a-list>


  </a-drawer>
</template>

<script lang="ts" setup>
import {LocalDrawer} from '@/libs/core'


const props = defineProps({record: {type: Object, required: true}})
const emit = defineEmits(['cancel'])


const localDrawer = new LocalDrawer(emit).setMD("配置详情");
const {LAYER, onCancel} = localDrawer
LAYER.title = `${props.record.title  }配置详情`
</script>
